import React, { Component } from 'react'
import { WingBlank, WhiteSpace, Card } from 'antd-mobile'
import PropTypes from 'prop-types'
class UserList extends Component {
  constructor(props) {
    super(props)
    this.state = {}
  }
  static propsTypes = {
    userList: PropTypes.array.isRequired
  }
  render() {
    return (
      <WingBlank>
        {this.props.userList.map(user => (
          <div key={user.id}>
            <WhiteSpace />
            <Card>
              <Card.Header thumb={user.header} extra={user.username} />
              <Card.Body>
                <div>职位：{user.post}</div>
                {user.company ? <div>公司：{user.company}</div> : null}
                {user.salary ? <div>月薪{user.salary}</div> : null}
                <div>描述：{user.info}</div>
              </Card.Body>
            </Card>
          </div>
        ))}
      </WingBlank>
    )
  }
}

export default UserList
